package com.mdsoft.dao.context;

import com.mdsoft.context.Context;
import com.mdsoft.dao.PlanDao;

public class ContextPlanDao implements PlanDao {

	@Override
	public void setPlan(int plan) {
		Context.getInstance().put(Context.PLAN, plan);
	}

	@Override
	public int getPlan() {
		Object object = Context.getInstance().get(Context.PLAN);
		if (object == null) {
			setPlan(PlanDao.PLAN_WAIT_SET);
			return PlanDao.PLAN_WAIT_SET;
		}
		return (Integer) object;
	}

}
